<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateGuildManageTable extends Migration
{
    protected $connection = 'guild';

    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('guild_manage', function (Blueprint $table) {
            $table->increments('id');
            $table->string('guild_id', 10)->default('')->comment('公会ID');
            $table->string('name', 50)->default('')->comment('公会名称');
            $table->string('login_account', 20)->default('')->comment('登录账号名');
            $table->string('login_pwd', 50)->default('')->comment('登录密码');
            $table->string('manager_phone', 11)->default('')->comment('负责人联系方式');
            $table->string('manager_name', 10)->default('')->comment('负责人姓名');
            $table->string('comp_name', 50)->default('')->comment('企业主体名');
            $table->string('comp_credit_code', 20)->default('')->comment('企业信用代码');
            $table->string('bank_account', 25)->default('')->comment('收款银行账号');
            $table->string('bank_id', 10)->default('')->comment('收款银行开户行');
            $table->string('credit_pics', 150)->default('')->comment('企业资质照片');
            $table->string('id_card_pics', 150)->default('')->comment('身份证照片');
            $table->double('guild_share_ratio', 2)->default(0.00)->comment('公会分成比例');
            $table->double('host_share_ratio', 2)->default(0.00)->comment('公会主播分成比例');
            $table->timestamps();
            $table->tinyInteger('status')->default(1)->comment('公会状态');
            $table->index('guild_id', 'guild_id');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('guild_manage');
    }
}
